**************************************
***** REPLICATION MATERIALS FOR ******
********NUANCED ACCOUNTABILITY********
****************BJPolS****************
**************************************
*D. de Kadt & E. Lieberman, 2017
*
*Please contact us if you find any issues: ddekadt@gmail.com, evanlieb@mit.edu
*
*This archive is in two parts. There are files that relate to the aggregate analyses, and files that relate to the individual analyses. To use the replication code as is, deposit all the files in a working directory. Add that working directory to the relevant R scripts as instructed in the commented code. Please create a folder in your working directory called "output." (Note: the resulting filenames do not correspond to the table and figure numbers in the paper or the appendix. Comments in the code indicate the correspondence with the outputs)

***
*The aggregate analyses require the following files: 
***
1) nuanced_accountability_ward.dta
The replication dataset for the ward-level analysis:
  obs:         4,277                          Written by R.              
 vars:            42                          2 May 2017 11:41
 size:     1,432,795                          

2) nuanced_accountability_aggregatefigures.R
R code for creating figure 1 in the paper and figure 1 in the appendix.

3) nuanced_accountability_aggregatereplicationNATIONAL.R
R code for creating all tabular results that use NATIONAL AND PROVINCIAL ELECTION results as DV, both in the paper and appendix.
(Note: this file also contains code for a number of other appendix tables -- summary statistics, endogeneity tests, and so forth.)

4) nuanced_accountability_aggregatereplicationLOCAL.R
R code for creating all tabular results that use LOCAL GOVERNMENT ELECTION results as DV, both in the paper and appendix.

***
*The individual analyses require the following files:
***
1) nuanced_accountability_southafrica.dta
The replication data for individual analyses of South Africans:
 obs:        12,330                          
 vars:           251                          2 May 2017 14:19
 size:    13,304,070                          

2) nuanced_accountability_botswana.dta
The replication data for Botswana:
  obs:         4,800                          Written by R.              
 vars:            42                          2 May 2017 14:19
 size:       806,400                          


3) nuanced_accountability_namibia.dta
The replication data for Namibia:
  obs:         4,799                          Written by R.              
 vars:            41                          2 May 2017 14:19
 size:       787,036                          


4) nuanced_accountability_lesotho.dta
The replication data for Lesotho:
  obs:         4,758                          Written by R.              
 vars:            30                          2 May 2017 14:19
 size:       570,960                          

5) nuanced_accountability_indivreplication.R
R code for creating all tabular and graphical results using individual data, either South Africa or BLN countries. 
(Note: Covariate matching tables (in appendix) are output only in R console)